#include "bsp_led.h"

static IWDG_HandleTypeDef hiwdg;

/* IWDG init function */
void MX_IWDG_Init(void) {
    hiwdg.Instance = IWDG;
    hiwdg.Init.Prescaler = IWDG_PRESCALER_32;
    hiwdg.Init.Reload = 4095;
    if (HAL_IWDG_Init(&hiwdg) != HAL_OK) {
        Error_Handler();
    }
}

void IWDG_Feed(void* arg) {
    //    LOG("Feed dog");
    LED_TOGGLE();
    HAL_IWDG_Refresh(&hiwdg);
}